package com.liangfeng.breezebrowser.browsermvp.view;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * 设置RecyclerView条目间距的辅助类
 * Created by mozhifeng on 2017/5/27.
 */

public class WindowDecoration extends RecyclerView.ItemDecoration {

    private int top;
    private int lefe;
    private int right;
    private int bottom;

    public WindowDecoration(int top, int lefe, int right, int bottom) {
        this.top = top;
        this.lefe = lefe;
        this.right = right;
        this.bottom = bottom;
    }

    @Override
    public void getItemOffsets(Rect outRect, int itemPosition, RecyclerView parent) {
        super.getItemOffsets(outRect, itemPosition, parent);
        outRect.left = lefe;
        outRect.right = right;
    }
}
